<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>信息发布列表</title>
		<meta name="decorator" content="default"/>
		<script type="text/javascript" src="${ctxStatic }/js/hidden_nav.js"></script>
		<link href="${ctxStatic}/jquery-pagination/pagination.css" rel="stylesheet" />
		<script type="text/javascript" src="${ctxStatic }/jquery-pagination/jquery-pagination.js"></script>
		<script type="text/javascript">
				var pagenum=parseInt("${pageNo-1}");
				var pagesize=parseInt("${pageSize}");
				var totalCount=parseInt("${count}");
			    $(function(){
					// 商品类别load
					var url_cate = "${ctx}/procatelist";
					$("#procate").load(url_cate);
					
					// 创建分页元素				
					$("#Pagination").pagination(totalCount, {
						num_edge_entries: 2,
						current_page: pagenum,
						items_per_page: pagesize,
						num_display_entries: pagesize,
						prev_text: "上一页",
						next_text:"下一页",
						num_display_entries: 8,
						callback: pageselectCallback  //回调函数
					});
			    });
			    
				function pageselectCallback(page_id, jq){
					$("#pageNo").val(page_id+1);
					$("#pageForm").submit();			
				}
			    
	    </script>
	</head>
<body>
<div class="main_centerbox">
	<div class="centerbox clearfix">
    	<div class="main_upbox clearfix">
        	<div class="navbox"  id="procate">
                	<!-- 商品类别 -->       
            </div>
            <div class="zxdt_box">
            <div class="zxdt_list">
            	<h3>信息列表</h3>
                <ul class="zxdt_sublist">
                    <c:forEach items="${cmsList}" var="cms" >
                    	<span><fmt:formatDate value="${cms.updateDate}" type="both" pattern="yyyy-MM-dd"/></span>
                        <li ><a href="${ctx }/cmsDetail?id=${cms.id}">【${cms.category.name}】 ${cms.titile}</a></li>
                     </c:forEach>
                </ul>
                <div class="zxdt_xinwen_list">
                	<div id="Pagination" class="pagination"></div>
					<form id="pageForm" method="post" action="${ctx}/cmslistindex?cmsCategory=${cmsCategory}&loginType=${loginType}">
						<input type="hidden" id="pageNo" name="pageNo" value="${pageNo }"/>
						<input type="hidden" id="pageSize" name="pageSize" value="${pageSize }"/>
					</form>
                </div>
            </div>
        </div>
            
        </div>       
    </div>
</div>
</body>
</html>